cmake_minimum_required(VERSION 3.10)
project(demo)
 
# 找到VTK
# Find VTK
set(VTK_DIR "E:\\environment\\vtk9.0\\lib\\cmake\\vtk-9.0")
find_package(VTK REQUIRED)
if (VTK_FOUND)
    message(STATUS "Found VTK ${VTK_VERSION}")
    message(STATUS "VTK INCLUDES:"${VTK_USE_FILE})
    message(STATUS "VTK LIBRARIES:"${VTK_LIBRARIES})
endif()
include(${VTK_USE_FILE})
 
# 添加可执行文件
add_executable(demo main.cpp)
 
# 链接VTK库
target_link_libraries(demo ${VTK_LIBRARIES})